<template>
	<view>
		<view class="file-item" @click="pushItem">
			<view class="file-name">
				<view class="title">
					{{title}}
				</view>
				<view class="name">
					{{time}}&nbsp;&nbsp;{{name}}
				</view>
			</view>
			<view class="file-img" v-if="url">
				<image src="../../static/news-2.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			title: String, //标题
			time: String, //时间
			name: String, //名字
			url: String, //图片路径
		},
		data() {
			return {

			};
		},
		methods: {
			pushItem() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="less">
	.file-item {
		border-bottom: 1px solid #CCCCCC;
		padding: 2px 0 5px 0;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin: 5px 0 5px 0;

		.file-ico {
			width: 180rpx;
			height: 100rpx;
			margin-left: 15px;
			background: #09BB07;

			image {
				width: 180rpx;
				height: 100rpx;
			}
		}

		.file-name {
			width: 70%;
			flex: 1;
			margin-left: 10px;
			display: flex;
			flex-direction: column;
			word-wrap: break-word;
			word-break: normal;

			.title {
				font-size: 14px;
				font-weight: bold;
				line-height: 20px;
				text-align: left;
			}

			.name {
				font-size: 12px;
				font-weight: 400;
			}
		}

		.file-img {
			width: 25%;
			margin-right: 5px;

			image {
				width: 100%;
				height: 120rpx;
			}
		}
	}
</style>
